<!-- 决算页面 整体页面 -->
<template>
  <div>
    <!-- 基本信息 -->
    <jn-prj-detail :prj-id="prjId" :prj-type="prjType" />
    <!-- 项目站址信息 -->
    <jn-site-detail v-if="basicList.manageMode !== '03'" :prj-id="prjId" />
    <!-- 项目专属信息 -->
    <jn-proprietary-detail :prj-id="prjId" :prj-type="prjType" />
    <!-- 实际时间表 -->
    <ActualTime ref="ActualTimeRef" v-if="basicList.manageMode" :basicList="basicList" :actual-time-list="actualTimeList" :url-list="urlList" :lc-list="lcList" :tableData="tableData"/>
    <!-- 计划进度时间表 -->
    <DesignScheduleTime ref="designScheduleTimeRef" :design-schedule-list="designScheduleList" :url-list="urlList" :lc-list="lcList" :basic-list="basicList" />
    <!-- 单项工程列表 -->
    <TCollapse v-if="['03','05'].includes(basicList.manageMode)" :title="basicList.manageMode==='03'?'单项工程列表':'子项目列表'">
      <BtnConfig v-if="showTitle" ref="btnConfigRef" class="marginBottom14" :btn-configs="basicList.manageMode==='05'?btnOption.filter(item=>item.fun!=='AssetAssembly'):btnOption" @propClick="btnClick" />
      <MyTable
        id="id"
        ref="myTableRef"
        :table-data="tableData"
        :columns="colOption"
        :col-option-enum="dicLists"
        :is-selection="true"
      >
        <template #projectName="{ scope }">
          <div class="pmsTableColor" @click="Look(scope)">{{ scope.projectName }}</div>
        </template>
      </MyTable>
      <pagination
        v-if="pageParam.total > 10"
        :total="pageParam.total"
        :page.sync="pageParam.pageNum"
        :limit.sync="pageParam.pageSize"
        @pagination="presentDataFun"
      />
    </TCollapse>
    <!-- 竣工决算信息 二次浇筑也不显示-->
    <BeCompletedMessage v-if="this.showTitle" ref="beCompletedMessageRef" :be-completed-message-list="beCompletedMessageList" :url-list="urlList" :lc-list="lcList" :basic-list="basicList" />
    <!-- 运营商订单信息 -->
    <OperatorMessage v-if="showOrderInfo" ref="operatorMessageRef" :operator-message-list="operatorMessageList" :url-list="urlList" :lc-list="lcList" />
    <!-- 结决算审核信息 -->
    <ReviewInformation ref="reviewInformationRef" :review-information-list="reviewInformationList" :url-list="urlList" :lc-list="lcList" :basic-list="basicList" />
    <!-- 工程档案信息 -->
    <EngineeringArchiveInformation ref="engineeringArchiveInformation" :engineering-archive-information-list="engineeringArchiveInformationList" :url-list="urlList" :lc-list="lcList" :prj-id="prjId" />
    <!-- 附件 -->
    <TCollapse title="附件">
      <iframe ref="myIframeFjRef" style="width:100%;" frameborder="0" scrolling="no" :src="fuJianSrc" />
    </TCollapse>
    <!-- 项目审批关闭信息 -->
    <jn-task-detail v-if="showShenPi" :process-inst-id="processInstId" />

    <!-- 单项工程查看弹框 -->
    <!-- <el-dialog
      ref="DialogRef"
      v-dialogDrag
      top="10vh"
      :close-on-click-modal="false"
      title="项目决算信息"
      :visible.sync="singleProjectDialogs"
      width="95%"
      height="100%"
      modal
      class="pms-dialog"
      :before-close="handleColse"
    >
      <div style="height:780px">
        <SingleProjectMessage
          ref="SingleProjectMessageRef"
          :url-list="urlList"
          :lc-list="lcList"
          :look-row="lookRow"
        />
        <PButton ref="btnConfigRef" class="marginBottom14" :btn-config="dialogBtnOption" :type="'center'" @propClick="dialogBtnClick" />
      </div>
    </el-dialog> -->
    <!-- 底部按钮 -->
    <FooterButton
      :button-disable="buttonDisable"
      @handleClose="handleClose"
      @handleNext="handleNext"
      @handleSave="handleSave"
      @handlereDeploy="handlereDeploy"
    />
    <!-- // 下一步 && 转派 -->
    <next-page
      v-if="nextPageVisible"
      ref="nextPage"
      :visible.sync="nextPageVisible"
      :activity-inst-id="workFlowData.activityInstID"
      :process-inst-id="workFlowData.processInstID"
      :activity-def-id="workFlowData.activityDefID"
      :process-def-name="workFlowData.processDefName"
      :prj-stage="prjStage"
      :prj-id="prjId"
      @doNextEntity="nextPageRes"
    />
    <reassign-pageNew
      v-if="ReassignPageVisible"
      ref="ReassignPage"
      :visible.sync="ReassignPageVisible"
      :process-inst-id="workFlowData.processInstID"
      :org-id="orgId"
      :org-code="orgCode"
      @redeployEntity="ReassignPageNewRes"
    />
  </div>
</template>

<script>
import { getQueryObject, msgInfoEl, setDocTitle } from '@/utils' // 获取url地址信息
import FooterButton from '@/components/footer/details'

import NextPage from '@/views/balance/components/txNextPage'
import ReassignPageNew from '@/components/nextPerson/ReassignPageNew'
import MyTable from '@/components/basic/myTable'
import SysConst from '@/common/const'
import TCollapse from '@/components/basic/TCollapse.vue'
import store from '@/store'

// 公共页面
import ActualTime from '@/views/actualBudget/communication/tFbusiness/actualTime'
import DesignScheduleTime from '@/views/actualBudget/communication/tFbusiness/designScheduleTime'
import BeCompletedMessage from '@/views/actualBudget/communication/tFbusiness/beCompletedMessage'
import EngineeringArchiveInformation from '@/views/actualBudget/communication/tFbusiness/engineeringArchiveInformation'
import OperatorMessage from '@/views/actualBudget/communication/tFbusiness/operatorMessage'
import ReviewInformation from '@/views/actualBudget/communication/tFbusiness/reviewInformation'
import { newOpenPostWindow } from '@/utils/newRequestCommonFormjs'
import BtnConfig from '@/components/basic/btnConfig.vue'

// 展示信息
import JnPrjDetail from '@/components/jn/JnPrjDetail.vue'
import JnSiteDetail from '@/components/jn/JnSiteDetail.vue'
import JnProprietaryDetail from '@/components/jn/JnProprietaryDetail.vue'
import JnTaskDetail from '@/components/jn/JnTaskDetail.vue'
// import * as Common from '@/api/common'
import {
  getWFWorkItem,
  getActualScheduleNew,
  getScheduleNew,
  queryTFinInfoNew,
  getOperatorOrderInfoNew,
  getAuditInfoNew,
  getSubprojectByPrjIdNew,
  getPrjDetail,
  finalVerifyNew,
  finalNextFlowPublicNew,
  getSelectJGJSBConfigNew,
  getUserInfoNew,
  applyTokenByCodeNew,
  getIsPushNew,
  confirmationOfArrivalNew
} from '@/api/actualBudget/tFbusiness'
import { clonePage } from '@/utils'
import { getTransferCapitalInfo } from '@/api/actualBudget/tFbusiness'

// 列表表头配置
const colOption = [
        { label: '项目编码', width: '', prop: 'prjCode' },
        { label: '项目名称', width: '380', prop: 'projectName' },
        { label: '项目类型', width: '', prop: 'prjTypeName' },
        { label: '建设方式', width: '', prop: 'buildModesName' },
        { label: '站址编码', width: '', prop: 'siteId' },
        { label: '站址名称', width: '', prop: 'siteName' },
        { label: '所属管理区域', width: '', prop: 'areaName' },
        { label: '当前节点', width: '', prop: 'nodeName' },
        { label: '当前办理人', width: '', prop: 'dealPerson' }
        // { label: '操作', width: '', prop: 'controls' }
]
// 列表按钮配置
const btnOption = [
    { label: '资产装配', fun: 'AssetAssembly', type: '' },
    { label: '查看竣工决算表', fun: 'selectJGJSB', type: '' },
    { label: '成本单信息', fun: 'costSheet', type: '' }
]

export default {
    name: 'AcceptMangeDetail',
    components: {
        TCollapse,
        FooterButton,
        ReassignPageNew,
        NextPage,
        ActualTime,
        DesignScheduleTime,
        BeCompletedMessage,
        EngineeringArchiveInformation,
        OperatorMessage,
        ReviewInformation,
        MyTable,
        BtnConfig,
        JnPrjDetail,
        JnSiteDetail,
        JnProprietaryDetail,
        JnTaskDetail
    },
    data() {
        return {
            junNanUrl: process.env.VUE_APP_JUNNAN_IFRAME_URL,
            fileUrl: process.env.VUE_APP_ZHONGRUAN_URL,
            colOption,
            btnOption,
            nextPageVisible: false, // 下一步
            ReassignPageVisible: false, // 下一步
            workFlowData: {
                activityInstID: null,
                processInstID: null, // 下一步 && 回退
                activityDefID: null,
                actInsetId: null, // 下一步 && 回退
                processDefName: ''
            },
            fuJianSrc: '',
            // entre: '',
            selectList: {},
            buttonDisable: ['save', 'doNext', 'redeploy', 'close'],
            DialogButtone: ['close'],
            basicList: {}, // 基本信息
            prjId: '',
            prjType: '',
            processInstId: '',
            lcList: {},
            urlList: {},
            btnConfig: 'C', //  A:默认，B：下载附件  C：默认+全览  D:下载附件+全览  E：默认+全览+数字图纸(废弃)   F：补传
            actualTimeList: {}, // 实际时间表数据
            designScheduleList: {}, // 计划进度时间表数据
            beCompletedMessageList: {}, // 竣工决算信息数据
            operatorMessageList: {}, // 运营商订单信息数据
            reviewInformationList: {}, // 结决算审核信息数据
            engineeringArchiveInformationList: {}, // 工程档案信息数据
            dicLists: {}, // 下拉框字典选项集合
            // 分页信息
            pageParam: {
              pageSize: SysConst.PAGESIZE, // 每页显示val条
              pageNum: SysConst.CURRENT_PAGE, // 当前页
              total: SysConst.TOTAL // 总数
            },
            tableData: [], // 单项工程列表
            orgCode: '',
            orgId: '',
            prjStage: 'G', // 流程阶段 固定的
            showShenPi: false
        }
    },
    computed: {
      showOrderInfo(){
        if(+this.basicList.isNewbusiness===2){
          return false
        }else{
         return this.basicList.prjType!=='Y'&&+this.basicList.isNewbusiness!==1
        }
      },
        showTitle() {
          return (this.basicList.prjType !== 'Q' && !(['07', '25'].includes(this.basicList.buildModes))) && (+this.basicList.prjTab !== 1)
        }
    },
    async created() {
        const { prjId, workItemId, processInstId, type } = getQueryObject()
        this.urlList = {
            prjId,
            workItemId,
            processInstId,
            type
          }
        if (this.urlList.workItemId) {
            // 待办
            const { data } = await getWFWorkItem({ workItemId: this.urlList.workItemId })
            this.lcList = data // 获取流程参数信息
            this.prjId = data.bizObject.prjId
        } else {
            // 综合查询
            this.prjId = this.urlList.prjId
            this.buttonDisable = []
            this.btnConfig = 'B'
        }
        if (this.urlList.processInstId) {
          this.processInstId = this.urlList.processInstId
        } else {
          this.processInstId = this.lcList.processInstID
        }
        await this.ifarmSrcPram()
        await this.presentDataFun()
        if (this.urlList.type === 'done' || this.urlList.type === '1') {
            // 单站我的已办
            this.buttonDisable = []
            this.btnConfig = 'B'
        }
        if (this.urlList.type === 'todo') {
            // 单站我的待办
            this.btnConfig = 'C'
        }
        if (this.basicList.manageMode === '03' && this.urlList.type === 'done' || this.urlList.type === '1') {
            // 整体项目我的已办
            this.buttonDisable = []
            this.btnConfig = 'B'
        }
        if (this.basicList.manageMode === '03' && this.urlList.type === 'todo') {
            // 整体项目我的待办
            this.btnConfig = 'C'
        }
        store.commit('settings/setPageTitle', `${this.lcList?.processInstName}-决算-关闭审核`)
        if (this.processInstId) {
          this.showShenPi = true
        }
    },
    async mounted() {
      this.getList()
    },
    methods: {
        // form展示信息获取,
        async presentDataFun(item) {
            // 实际时间表
            const getActualSchedule = await getActualScheduleNew({ prjId: this.prjId })
            if (getActualSchedule.code === '200') {
                this.actualTimeList = getActualSchedule.data
            }
            // 计划进度时间表
            const getSchedule = await getScheduleNew({ prjId: this.prjId })
            if (getSchedule.code === '200') {
                this.designScheduleList = getSchedule.data
            }
            // 竣工决算信息
            const queryTFinInfo = await queryTFinInfoNew({ prjId: this.prjId })
            if (queryTFinInfo.code === '200') {
                this.beCompletedMessageList = queryTFinInfo.data
                this.engineeringArchiveInformationList = queryTFinInfo.data
            }
            // 运营商订单信息
            const getOperatorOrderInfo = await getOperatorOrderInfoNew({ prjId: this.prjId, demandId: this.basicList.demandId })
            if (getOperatorOrderInfo.code === '200') {
                this.operatorMessageList = getOperatorOrderInfo.data
            }
            // 结决算审核信息
            const getAuditInfo = await getAuditInfoNew({ prjId: this.prjId })
            if (getAuditInfo.code === '200') {
                this.reviewInformationList = getAuditInfo.data
            }
            // 查询单项工程列表
            if (['03','05'].includes(this.basicList.manageMode)) {
              const getSubprojectByPrjId = await getSubprojectByPrjIdNew({ prjId: this.prjId, pageNum: item?.page || SysConst.CURRENT_PAGE, pageSize: item?.limit || SysConst.PAGESIZE })
              if (getSubprojectByPrjId.code === '200') {
                    this.tableData = getSubprojectByPrjId.data.records
                    this.pageParam.total = getSubprojectByPrjId.data?.total || 0
                    // this.pageParam.pageSize = getSubprojectByPrjId.data?.pageSize || SysConst.PAGESIZE
                    // this.pageParam.pageNum = getSubprojectByPrjId.data?.pageNum || SysConst.CURRENT_PAGE
              }
            }
        },
        async getList() {
            window.addEventListener('message', (event) => {
              const base_url = ''
              if (event.origin === base_url) {
                return
              }
                if (event.data.type === 'attachment') {
                    this.$refs.myIframeFjRef.style.height = event.data.height + 'px'
                    // console.log('附件高度')
                }
            })
        },
        // ifarm src 传参
        async ifarmSrcPram() {
            await getPrjDetail({ prjId: this.prjId }).then(res => {
                this.basicList = res.data // 获取基本信息
                this.prjType = this.basicList.prjType
                this.orgCode = res.data.orgCode
                this.orgId = res.data.orgId
            })

            var iframeParams = {
                prjType: this.basicList.prjType,
                nodeId: this.lcList.activityDefID, // activityDefID 流程节点ID
                buildModes: this.basicList.buildModes,
                orgId: this.basicList.orgId,
                towerType: '0',
                roomType: '0',
                prjId: this.basicList.prjId,
                projectId:this.prjId,
                prjStage: 'G',
                fileSupplierCode: '', // 供应商接口
                isChange: '0', // 默认传0
                operateType: '1', // 默认传1
                btnConfig: this.btnConfig// 默认传A .综合查询传B
            }
            // 附件信息
            if (this.urlList.workItemId) {
                // 待办地址
                this.fuJianSrc = `${this.fileUrl}attachmentInfoTodo?prjType=${iframeParams.prjType}&nodeId=${iframeParams.nodeId}&buildModes=${iframeParams.buildModes}&towerType=${iframeParams.towerType}&roomType=${iframeParams.roomType}&prjId=${iframeParams.prjId}&prjStage=${iframeParams.prjStage}&fileSupplierCode=${iframeParams.fileSupplierCode}&isChange=${iframeParams.isChange}&operateSystem=${iframeParams.operateSystem}&operateType=${iframeParams.operateType}&btnConfig=${iframeParams.btnConfig}&orgId=${iframeParams.orgId}&projectId=${iframeParams.projectId}`
            } else {
                // 综合查询地址
                this.fuJianSrc = `${this.fileUrl}attachmentInfo?prjType=${iframeParams.prjType}&nodeId=${iframeParams.nodeId}&buildModes=${iframeParams.buildModes}&towerType=${iframeParams.towerType}&roomType=${iframeParams.roomType}&prjId=${iframeParams.prjId}&prjStage=${iframeParams.prjStage}&fileSupplierCode=${iframeParams.fileSupplierCode}&isChange=${iframeParams.isChange}&operateSystem=${iframeParams.operateSystem}&operateType=${iframeParams.operateType}&btnConfig=${iframeParams.btnConfig}&orgId=${iframeParams.orgId}&projectId=${iframeParams.projectId}`
            }
        },
        // 操作查看
        Look(row) {
          // const toUrl = `${this.fileUrl}singleProjectMessage`
          // const params = {
          //   prjId: row.prjId,
          //   type: 'done'
          // }
          window.open(`${this.fileUrl}singleProjectMessage?prjId=${row.prjId}&type=done`)
          // newOpenPostWindow(toUrl, params)
        },
        DialogButtoneClose() {
          console.log('执行')
        },
        // 保存
        async handleSave(item) {
            const ifNextVal = '0' // 保存 0
            this.nextBackPageRes(item, ifNextVal)
        },
        // 转派
        async handlereDeploy(item) {
          this.workFlowData = {
            activityInstID: this.lcList.activityInstID,
            processInstID: this.lcList.processInstID,
            activityDefID: this.lcList.activityDefID,
            processDefName: this.lcList.processInstName
          }
          this.ReassignPageVisible = true
        },
        // 下一步
        handleNext() {
          if (!this.engineeringArchiveInformationList.isQualified) {
              this.$message({
                    message: '请确认工程档案是否完备',
                    type: 'warning'
              })
              return
          }
        if (this.engineeringArchiveInformationList.isQualified === '0') {
            this.$message({
                message: '项目工程档案资料还不完备，不允许关闭项目',
                type: 'warning'
            })
            return
        }
          this.$confirm('项目关闭后将无法修改项目的所有信息，您是否确认要关闭项目？', '提醒', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              cancelButtonClass: 'pms-zr-button',
              confirmButtonClass: 'pms-zr-button-primary',
              type: 'warning'
          }).then(() => {
              this.Next()
          })
        },
        async Next() {
          // 转资校验
          var forTotalMoney = this.beCompletedMessageList.forTotalMoney
          var forMoneyTime = this.beCompletedMessageList.forMoneyTime
          var zanguMoney = this.beCompletedMessageList.zanguMoney
          var zanguyTime = this.beCompletedMessageList.zanguTime
          var costAmount = this.beCompletedMessageList.costAmount
          console.log(this.beCompletedMessageList, 'this.refbeClDetail')
          // 投资类的需要校验财务是否转资
          // 正式竣工决算时间金额不为空或者暂估时间金额不为空才可进行下一步操作
          if (this.MoneyTimeCheckOne(forTotalMoney, forMoneyTime, zanguMoney, zanguyTime) && (costAmount == null || costAmount === '') && this.showTitle) {
              this.$message({
                  message: '财务系统未转资完成，请联系财务系统核实，或点击【获取财务转资信息】按钮，重新获取财务转资结果',
                  type: 'warning',
                  dangerouslyUseHTMLString: true
              })
              return
          }
          // 后端校验
          const data = {
              prjId: this.prjId,
              nodeId: this.lcList.activityDefID,
              isNewBusiness:this.basicList.isNewbusiness
          }
          const finalVerify = await finalVerifyNew(data)
          if (finalVerify.data.check === false) {
            const msg = finalVerify.data.msg
              this.$message({
                    dangerouslyUseHTMLString: true,
                    message: msg,
                    type: 'warning'
              })
          } else {
            this.workFlowData = {
              activityInstID: this.lcList.activityInstID,
              processInstID: this.lcList.processInstID,
              activityDefID: this.lcList.activityDefID,
              processDefName: this.lcList.processInstName
            }
            this.nextPageVisible = true
          }
        },
        // 2024-10-8 阻断问题if过多解决方案
        MoneyTimeCheckOne(forTotalMoney, forMoneyTime, zanguMoney, zanguyTime) {
          return (forTotalMoney == null || forMoneyTime === '') && (zanguMoney == null || zanguyTime === '')
        },
        // 下一步确认回调
        nextPageRes(item) {
            const ifNextVal = '1' // 下一步传 1
            this.nextBackPageRes(item, ifNextVal)
        },
        // 转派回调
        ReassignPageNewRes(item) {
            const ifNextVal = '2' // 转派2
            this.nextBackPageRes(item, ifNextVal)
        },
        // 下一步 && 转派 && 保存
        async nextBackPageRes(item, ifNextVal) {
          var workFlowFlag = ''
          var messageVal = ''
          if (ifNextVal === '0') {
            workFlowFlag = 'save'
            messageVal = '保存成功'
          } else if (ifNextVal === '1') {
            workFlowFlag = 'doNext'
            messageVal = '提交成功'
          } else {
            workFlowFlag = 'doReassign'
            messageVal = '转派成功'
          }
          
          const data = {
              prjId: this.prjId,
              workFlowFlag: workFlowFlag,
              nextNodeId: item ? item.nodeId : '',
              workItemId: this.urlList.workItemId,
              opinion: item ? item.opinion : '',
              endDianxinInstalDate: this.operatorMessageList.endDianxinInstalDate,
              endCmccInstalDate: this.operatorMessageList.endCmccInstalDate,
              endLiantongInstalDate: this.operatorMessageList.endLiantongInstalDate,
              isQualified: this.engineeringArchiveInformationList.isQualified,
              buildModes: this.basicList.buildModes,
              isOrder: this.basicList.isOrder,
              userIds: item?.userId ? item?.userId : item?.empId
          }
          const finalNextFlowPublic = await finalNextFlowPublicNew(data)
          if (finalNextFlowPublic.code === '200') {
            if (ifNextVal === '0') {
              this.$message({
                message: messageVal,
                type: 'success'
              })
            }
            if (ifNextVal !== '0') {
              this.doClosedoReassign(ifNextVal)
            }
          }
        },
        doClosedoReassign(ifNextVal){
          const enumTitle = {
            '1': '提交成功',
            '2': '转派成功'
          }
          this.$alert(`${enumTitle[ifNextVal]}`, '系统提示', {
            confirmButtonText: '确认',
            cancelButtonClass: 'pms-zr-button',
            callback: action => {
              this.handleClose()
            }
          })
        },
        // 列表按钮点击事件
        btnClick(fun, row) {
            this[fun](row)
        },
        // 成本单信&资产装配&决算竣工表校验
        verificationFun(row) {
          let verificationVal = 0
          if (row.length === 0) {
              verificationVal = 1
              this.$message({
                    message: '请选择一条数据进行操作',
                    type: 'warning'
                })
            }
            if (row.length > 1) {
              verificationVal = 1
              this.$message({
                      message: '当前仅支持单条数据操作',
                      type: 'warning'
                  })
            }
            return verificationVal
        },
        // 成本单信息
        async costSheet(row) {
            const verificationIf = this.verificationFun(row)
            if (verificationIf && verificationIf === 1) {
              return
            }
            let orgCodeVal = ''
            await getPrjDetail({ prjId: row[0].prjId }).then(res => {
                orgCodeVal = res.data.orgCode // 获取orgCode
            })
            const today = new Date()
            const year = today.getFullYear()
            const month = today.getMonth() + 1 // 注意，getMonth()方法返回月份是从0开始的，所以需要加1
            const day = today.getDate()
            const endTime = year + '-' + month + '-' + day

            var getUserInfoList = {}
            var applyTokenByCodeList = {}
            var getSelectJGJSBConfigList = {}

            // 决算: 查询竣工决算表配置信息接口
            const getSelectJGJSBConfig = await getSelectJGJSBConfigNew({ itfCodeStatus: '1' })
            if (getSelectJGJSBConfig.code === '200') {
                getSelectJGJSBConfigList = getSelectJGJSBConfig.data
            }
            // 决算: 获取用户信息接口
            const getUserInfo = await getUserInfoNew({ })
            if (getUserInfo.code === '200') {
                getUserInfoList = getUserInfo.data
            }
            // 决算:
            const applyTokenByCode = await applyTokenByCodeNew({ serviceId: 'CHNTFMS', loginAcct: getUserInfoList.user.loginName })
            if (applyTokenByCode.code === '200') {
                applyTokenByCodeList = applyTokenByCode.data
                // 2022-04-28 跳转页面使用post方式
                var pwdaToken = applyTokenByCodeList.TOKEN
                var acctId = applyTokenByCodeList.ACCTID
                var toUrl = getSelectJGJSBConfigList.servUrl
                var params = {}
                    params.pwdaToken = pwdaToken
                    params.acctId = acctId
                    params.Login = 'PMS_COST'
                    params.flag = '1'
                    params.ENDTIME = endTime
                    params.STARTTIME = '2015-01-01'
                    params.XMBH = row[0].prjCode
                    params.DWBH = orgCodeVal
                    newOpenPostWindow(toUrl, params)
            }
        },
        async getFinancialTransferInfo() {
            getTransferCapitalInfo(this.prjId).then((res) => {
                if (+res.code === 200) {
                    this.beCompletedMessageList.zanguMoney = res.data.zanguMoney
                    this.beCompletedMessageList.zanguTime = res.data.zanguTime
                    this.beCompletedMessageList.forTotalMoney = res.data.forTotalMoney
                    this.beCompletedMessageList.forMoneyTime = res.data.forMoneyTime
                    if (res.message) {
                        this.$message({
                            // 将html化
                            dangerouslyUseHTMLString: true,
                            message: res.message,
                            type: 'error'
                        })
                    } else {
                        msgInfoEl({
                            type: 'success',
                            message: '获取成功'
                        })
                    }
                }
            })
        },
        // 2024-10-09阻断问题if过多解决方案
        optimizeNewOne(row) {
          return (+row[0].parentPrjId !== 0 && +row[0].parentPrjId !== -1 && row[0].parentPrjId !== '' && row[0].parentPrjId !== null)
        },
        // 资产装配
        async AssetAssembly(row) {
            const verificationIf = this.verificationFun(row)
            if (verificationIf && verificationIf === 1) {
              return
            }
            var arrivalState = false
            var prjId = this.optimizeNewOne(row) ? row[0].parentPrjId : row[0].prjId
            var isPush = ''
            var getUserInfoList = {}
            var applyTokenByCodeList = {}
            var getSelectJGJSBConfigList = {}

            const getIsPush = await getIsPushNew({ prjId: prjId })
            if (getIsPush.code === '200') {
                isPush = getIsPush.data
            }
            if (isPush === '1') {
                const confirmationOfArrival = await confirmationOfArrivalNew({ prjId: prjId, queryType: '6' })
                if (confirmationOfArrival.code === '200') {
                    arrivalState = true
                }
                if (confirmationOfArrival.code === '1019') {
                    msgInfoEl({
                        message: confirmationOfArrival.message || '操作异常',
                        type: 'error'
                    })
                }
            } else {
                this.$message({
                    message: '物资未推送商合！',
                    type: 'warning'
                })
            }

            if (arrivalState === false) {
                return
            }

            // 决算: 查询竣工决算表配置信息接口
            const getSelectJGJSBConfig = await getSelectJGJSBConfigNew({ itfCodeStatus: '1' })
            if (getSelectJGJSBConfig.code === '200') {
                getSelectJGJSBConfigList = getSelectJGJSBConfig.data
            }
            // 决算: 获取用户信息接口
            const getUserInfo = await getUserInfoNew({ })
            if (getUserInfo.code === '200') {
                getUserInfoList = getUserInfo.data
            }
            // 决算: 获取财务token(登录信息)接口
            const applyTokenByCode = await applyTokenByCodeNew({ serviceId: 'CHNTFMS', loginAcct: getUserInfoList.user.loginName })
            if (applyTokenByCode.code === '200') {
                applyTokenByCodeList = applyTokenByCode.data
                // 2022-04-28 跳转页面使用post方式
                var pwdaToken = applyTokenByCodeList.TOKEN
                var acctId = applyTokenByCodeList.ACCTID
                var toUrl = getSelectJGJSBConfigList.servUrl
                var params = {}
                    params.pwdaToken = pwdaToken
                    params.acctId = acctId
                    params.Login = 'PMS_ZP'
                    params.flag = '1'
                    console.log(toUrl, params, 'toUrlparams')
                    newOpenPostWindow(toUrl, params)
            }
        },
        // 查看 决算竣工表
        async selectJGJSB(row) {
            const verificationIf = this.verificationFun(row)
            if (verificationIf && verificationIf === 1) {
              return
            }
            var getSelectJGJSBConfigList = {}
            var getUserInfoList = {}
            var applyTokenByCodeList = {}

            // 决算: 查询竣工决算表配置信息接口
            const getSelectJGJSBConfig = await getSelectJGJSBConfigNew({ itfCodeStatus: '0' })
            if (getSelectJGJSBConfig.code === '200') {
                getSelectJGJSBConfigList = getSelectJGJSBConfig.data
            }

            // 决算: 获取用户信息接口
            const getUserInfo = await getUserInfoNew({})
            if (getUserInfo.code === '200') {
                getUserInfoList = getUserInfo.data
            }

            // 决算: 获取财务token(登录信息)接口
            const applyTokenByCode = await applyTokenByCodeNew({ serviceId: 'CHNTFMS', loginAcct: getUserInfoList.user.loginName })
            if (applyTokenByCode.code === '200') {
                applyTokenByCodeList = applyTokenByCode.data
                // 2022-04-28 跳转页面使用post方式
                var pwdaToken = applyTokenByCodeList.TOKEN
                var acctId = applyTokenByCodeList.ACCTID
                var toUrl = getSelectJGJSBConfigList.servUrl
                var params = {}
                params.pwdaToken = pwdaToken
                params.acctId = acctId
                params.Login = 'PMS_COST'
                params.AuthType = 'UserCode'
                params.AppCode = '0001'
                params.UserCode = getUserInfoList.user.loginName
                params.callType = '1'
                params.flag = '1'
                params.callPara = '/cwbase/web/session/gsprtf/adpdebug.aspx?ADPUrl=/cwbase/web/gspadp/debug/45b71827-ba5b-42db-9df2-b2acd53e620c/Index.html'
                console.log(toUrl, params, 'toUrlparams')
                newOpenPostWindow(toUrl, params)
            }
        },
        // 关闭
        handleClose() {
            clonePage()
        }
    }
}
</script>

<style lang="scss" scoped>
.el-collapse {
    margin-bottom: 15px;
}

.el-collapse-item {
    box-shadow: 0px 0px 6px 0px rgba(191, 192, 192, 0.52);
    /* 调整各个item之间的距离为20px */
    /* border: 1px; */
}

.el-collapse-item__wrap {
    padding: 0 20px;
    /* 为el-collapse-item的内容添加20像素的padding */
}

.el-collapse-item__header {
    padding-left: 20px;
    font-size: 14px;
    color: #333333;
    letter-spacing: 0;
    font-weight: 600;
}

.item_icon {
    width: 6px;
    background: rgb(235, 75, 75);
    height: 15px;
    margin-right: 10px;
    border-radius: 10px;
}

::v-deep .content-box {
    width: 100%;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 400;
    // line-height: 28px;
}
::v-deep .el-icon-arrow-right:before {
  content: "\e6e0" !important;
}
::v-deep .el-table--border {
    border-right: none !important;
}

.pmsTableColor {
    color: #33aaff !important;
    cursor: pointer !important;
}
</style>
